/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entityprojet;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author T.Ron
 */
@Entity
@Table(name = "COMPTET")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Comptet.findAll", query = "SELECT c FROM Comptet c"),
    @NamedQuery(name = "Comptet.findByIdCt", query = "SELECT c FROM Comptet c WHERE c.idCt = :idCt"),
    @NamedQuery(name = "Comptet.findByNumct", query = "SELECT c FROM Comptet c WHERE c.numct = :numct"),
    @NamedQuery(name = "Comptet.findByLibellect", query = "SELECT c FROM Comptet c WHERE c.libellect = :libellect"),
    @NamedQuery(name = "Comptet.findByTelct", query = "SELECT c FROM Comptet c WHERE c.telct = :telct"),
    @NamedQuery(name = "Comptet.findByAdressect", query = "SELECT c FROM Comptet c WHERE c.adressect = :adressect"),
    @NamedQuery(name = "Comptet.findByMobilect", query = "SELECT c FROM Comptet c WHERE c.mobilect = :mobilect"),
    @NamedQuery(name = "Comptet.findByVillect", query = "SELECT c FROM Comptet c WHERE c.villect = :villect"),
    @NamedQuery(name = "Comptet.findByEmailct", query = "SELECT c FROM Comptet c WHERE c.emailct = :emailct"),
    @NamedQuery(name = "Comptet.findByNumrc", query = "SELECT c FROM Comptet c WHERE c.numrc = :numrc"),
    @NamedQuery(name = "Comptet.findByNumcontrib", query = "SELECT c FROM Comptet c WHERE c.numcontrib = :numcontrib"),
    @NamedQuery(name = "Comptet.findByRegionct", query = "SELECT c FROM Comptet c WHERE c.regionct = :regionct"),
    @NamedQuery(name = "Comptet.findByPaysct", query = "SELECT c FROM Comptet c WHERE c.paysct = :paysct"),
    @NamedQuery(name = "Comptet.findBySitect", query = "SELECT c FROM Comptet c WHERE c.sitect = :sitect")})
public class Comptet implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_CT")
    private Integer idCt;
    @Basic(optional = false)
    @Column(name = "NUMCT")
    private String numct;
    @Basic(optional = false)
    @Column(name = "LIBELLECT")
    private String libellect;
    @Column(name = "TELCT")
    private String telct;
    @Column(name = "ADRESSECT")
    private String adressect;
    @Column(name = "MOBILECT")
    private String mobilect;
    @Column(name = "VILLECT")
    private String villect;
    @Column(name = "EMAILCT")
    private String emailct;
    @Column(name = "NUMRC")
    private String numrc;
    @Column(name = "NUMCONTRIB")
    private String numcontrib;
    @Column(name = "REGIONCT")
    private String regionct;
    @Column(name = "PAYSCT")
    private String paysct;
    @Column(name = "SITECT")
    private String sitect;
    @ManyToMany(mappedBy = "comptetCollection")
    private Collection<Compteg> comptegCollection;
    @OneToMany(mappedBy = "idCt")
    private Collection<Ecriturec> ecriturecCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "comptet")
    private Collection<Banquet> banquetCollection;
    @JoinColumn(name = "TYPECT", referencedColumnName = "NUMTYPECT")
    @ManyToOne(optional = false)
    private Typect typect;
    @JoinColumn(name = "NUMCG_P", referencedColumnName = "NUMCG")
    @ManyToOne(optional = false)
    private Compteg numcgP;

    public Comptet() {
    }

    public Comptet(Integer idCt) {
        this.idCt = idCt;
    }

    public Comptet(Integer idCt, String numct, String libellect,Typect typect,Compteg numcgP) {
        this.idCt = idCt;
        this.numct = numct;
        this.libellect = libellect;
        this.typect=typect;
        this.numcgP = numcgP;
    }

    public Comptet(Integer idCt, String numct, String libellect,Typect typect) {
        this.idCt = idCt;
        this.numct = numct;
        this.libellect = libellect;
        this.typect=typect;
      //  this.numcgP = numcgP;
    }
    
    public Integer getIdCt() {
        return idCt;
    }

    public void setIdCt(Integer idCt) {
        this.idCt = idCt;
    }

    public String getNumct() {
        return numct;
    }

    public void setNumct(String numct) {
        this.numct = numct;
    }

    public String getLibellect() {
        return libellect;
    }

    public void setLibellect(String libellect) {
        this.libellect = libellect;
    }

    public String getTelct() {
        return telct;
    }

    public void setTelct(String telct) {
        this.telct = telct;
    }

    public String getAdressect() {
        return adressect;
    }

    public void setAdressect(String adressect) {
        this.adressect = adressect;
    }

    public String getMobilect() {
        return mobilect;
    }

    public void setMobilect(String mobilect) {
        this.mobilect = mobilect;
    }

    public String getVillect() {
        return villect;
    }

    public void setVillect(String villect) {
        this.villect = villect;
    }

    public String getEmailct() {
        return emailct;
    }

    public void setEmailct(String emailct) {
        this.emailct = emailct;
    }

    public String getNumrc() {
        return numrc;
    }

    public void setNumrc(String numrc) {
        this.numrc = numrc;
    }

    public String getNumcontrib() {
        return numcontrib;
    }

    public void setNumcontrib(String numcontrib) {
        this.numcontrib = numcontrib;
    }

    public String getRegionct() {
        return regionct;
    }

    public void setRegionct(String regionct) {
        this.regionct = regionct;
    }

    public String getPaysct() {
        return paysct;
    }

    public void setPaysct(String paysct) {
        this.paysct = paysct;
    }

    public String getSitect() {
        return sitect;
    }

    public void setSitect(String sitect) {
        this.sitect = sitect;
    }

    @XmlTransient
    public Collection<Compteg> getComptegCollection() {
        return comptegCollection;
    }

    public void setComptegCollection(Collection<Compteg> comptegCollection) {
        this.comptegCollection = comptegCollection;
    }

    @XmlTransient
    public Collection<Ecriturec> getEcriturecCollection() {
        return ecriturecCollection;
    }

    public void setEcriturecCollection(Collection<Ecriturec> ecriturecCollection) {
        this.ecriturecCollection = ecriturecCollection;
    }

    @XmlTransient
    public Collection<Banquet> getBanquetCollection() {
        return banquetCollection;
    }

    public void setBanquetCollection(Collection<Banquet> banquetCollection) {
        this.banquetCollection = banquetCollection;
    }

    public Typect getTypect() {
        return typect;
    }

    public void setTypect(Typect typect) {
        this.typect = typect;
    }

    public Compteg getNumcgP() {
        return numcgP;
    }

    public void setNumcgP(Compteg numcgP) {
        this.numcgP = numcgP;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCt != null ? idCt.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Comptet)) {
            return false;
        }
        Comptet other = (Comptet) object;
        if ((this.idCt == null && other.idCt != null) || (this.idCt != null && !this.idCt.equals(other.idCt))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityprojet.Comptet[ idCt=" + idCt + " ]";
    }
    
}
